How can I set different sound for different players by using [[SimpleAudioEngine sharedEngine] playE

Posted by srikanth rongali on Stack Overflow See other posts from Stack Overflow or by srikanth rongali
Published on 2010-05-18T05:54:11Z Indexed on 2010/05/18 6:00 UTC
Read the original article Hit count: 169

I need to set sounds for different players in my game. There are 10 players. And I have 10 sounds. The players are loaded int his way

for( int i = 1; i <5; i++ )

    {
        [playerAnimation addFrameWithFilename: [NSString stringWithFormat:@"Player %02d gun draw_%02d.png", playerNumber, i]];
    }

How can I set the sounds in this way by giving the filenames. And player1 shoots player1sound should play. How can I do it using

 [[SimpleAudioEngine sharedEngine] playEffect:@"player1.sound.wav"];

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about cocos2d-iphone